/**
 * 
 */
package com.kunbo.cn.service.impl.core.inventory;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.kunbo.cn.dao.core.inventory.CarrierUserDao;
import com.kunbo.cn.dao.core.inventory.UserAuthorityDao;
import com.kunbo.cn.entity.core.inventory.CarrierUser;
import com.kunbo.cn.entity.core.inventory.UserAuthority;
import com.kunbo.cn.service.core.inventory.UserAuthorityService;
import com.kunbo.cn.util.date.SDate;

/**
 *
 * @author bjl  
 * @date 2019年3月14日 
 */
@Service
public class UserAuthorityServiceImpl implements UserAuthorityService{
	@Autowired
    private  JdbcTemplate jdbc;
	@Autowired
	private UserAuthorityDao UseraDao;
	@Override
	public void save(List<UserAuthority> useauthty) {
		//useauthty.setCreate_time(SDate.getSystemDateToString());
		System.out.println(SDate.getSystemDateToString()+"^^^^^^^^^^^^^V^^^^^^^^^^^^^^^^");
		
		UseraDao.save(useauthty);
	}

	@Override
	public void delete(String id){
		UseraDao.delete(id);
	}
	@Override
	public List<Map<String, Object>> findUserAuthority(String userid) {
			String sql = "select * from business_carrieruser_authority_manage where carrier_id = '"+userid+"'";
			return jdbc.queryForList(sql);// carrier,type,create_time,createby
	}

}
